<#include "common_var.include"/> 
<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@include file="/common/header.jsp" %>
<script type="text/javascript">
$(document).ready(function() {
	//校验 
	$('#qryFormId').validationEngine('detach');
});

function doSearch(pageNo){
	if(pageNo){$("#currentPage").val(pageNo);}
	submitForm("qryFormId");
}
//增加、修改、删除动作
function doAction(atn, recordId) {
	if('add' == atn){
		var url = '${classNameLower}Action!input.action';
		art.dialog.open(url,{
			width: '100%',height: '100%',left: '0%',top: '0%',fixed: true,resize: false,drag: false,lock:true,
			title:false,
			closeFn:function(){
				doSearch();
			}
		});
	}else if('view' == atn) {
		var url = '${classNameLower}Action!toView.action?recordId='+recordId;
		art.dialog.open(url,{
			width: '100%',height: '100%',left: '0%',top: '0%',fixed: true,resize: false,drag: false,lock:true,
			title:false,
			closeFn:function(){
				doSearch();
			}
		});
	}
}
</script>
</head>
<body>
<div class="topnav"><p>模块  &gt;  &gt; ${tableClazz.tableAlias}列表</p></div>
<!--动作,增加修改删除,必须-->
<div class="x-toolbar-small">
	<ul class="toolbar-btn_small">
		<li><p><a class="icon-search-big" href="#" id="hrQry" onclick="javascript:doSearch(1);">查找</a></p></li>
		<li class="toolbar-sprit"></li>
		<li><p><a class="icon-add-big" href="#" target="_self" onclick="javascript:doAction('add');">新增</a></p></li>
		<li class="toolbar-sprit"></li>
		<!-- <li><p><a class="icon_reset-big" href="#" onclick="resetCondition();">重置</a></p></li>  -->
	</ul>
</div>
<!-- 查询 -->
<div class="wrapper">
	<div class="title"><p>查询</p></div>
	<div class="contant">
	<form action="${classNameLower}Action.action" method="post" id="qryFormId">
	<input type="hidden" id="currentPage" name="currentPage" value="<@jspEl 'currentPage'/>" />
	
	<#assign porpNo = 0>
	<table class="formTable">
	<#list tableClazz.getQueryCols() as prop>
	<#-- 过滤掉不用的字段 -->
	<#if (!prop.propName?ends_with("remark")) && prop.propName != "versionNo" && prop.propName != "class" && prop.propName != "updateUser" && prop.propName != "updateTime" && prop.propName != "createTime" && prop.propName != "createUser">
	<#assign porpNo=porpNo+1><#if (porpNo==1 || (porpNo-1) % 3 ==0)><tr></#if>
	<#if prop.editor.editTypeCode=='date'||prop.editor.editTypeCode=='datetime'>  	  
	  	<td class="labelStyle"><label>${prop.propCnName} 起</label></td>
	    <td>
	    	<input id="qId${prop.propName?cap_first}_start" name="conditionMap.${prop.propName}_start" value="<@jspEl 'conditionMap.${prop.propName}_start'/>"  type="text" style="width:120px;" class="Wdate" onclick="WdatePicker({maxDate:'#F{$dp.$D(\'qId${prop.propName?cap_first}_end\')}',dateFmt:'yyyy-MM-dd<#if prop.editor.editTypeCode=="datetime"> HH:mm</#if>'})"/>
	    </td>
	<#if (porpNo!=1 && porpNo % 3 ==0)></tr></#if>
	<#assign porpNo=porpNo+1><#if (porpNo==1 || (porpNo-1) % 3 ==0)><tr></#if>
		<td class="labelStyle"><label>${prop.propCnName} 止</label></td>
	    <td>
	    	<input id="qId${prop.propName?cap_first}_end" name="conditionMap.${prop.propName}_end" value="<@jspEl 'conditionMap.${prop.propName}_end'/>"  type="text" style="width:120px;" class="Wdate" onclick="WdatePicker({minDate:'#F{$dp.$D(\'qId${prop.propName?cap_first}_start\')}',dateFmt:'yyyy-MM-dd<#if prop.editor.editTypeCode=="datetime"> HH:mm</#if>'})"/>
	    </td>
	<#elseif prop.editor.editTypeCode=='dialog'>
	   	<td class="labelStyle"><label>${prop.propCnName}</label></td>
	    <td>
	    	<input id='qId${prop.idLabel?cap_first}Name' name="conditionMap.${prop.idLabel?cap_first}Name" value="<@jspEl 'conditionMap.${prop.idLabel?cap_first}Name'/>"  class="inputStyle" type="text" />	
	   		<a class="selectedIco" href="#" onclick="open${prop.idLabel?cap_first}Dialog('qId${prop.propName?cap_first}','qId${prop.idLabel?cap_first}Name');"></a>
	    	<input id='qId${prop.propName?cap_first}' name="conditionMap.${prop.propName}" value="<@jspEl 'conditionMap.${prop.propName}'/>" type="hidden"/>	
	   	</td>
	<#elseif prop.editor.editTypeCode=='select'>
		<td class="labelStyle"><label>${prop.propCnName}</label></td>
		<td>
			<s:select id='qId${prop.propName?cap_first}' cssStyle="width:122px" name="conditionMap.${prop.propName}" list="${prop.idLabel}Map" cssClass="inputStyle ${prop.ruleHtml}" headerKey="" headerValue=""></s:select>
		</td>
	<#else>
	   	<td class="labelStyle"><label>${prop.propCnName}</label></td>
	    <td>
	    	<input id='qId${prop.propName?cap_first}' name="conditionMap.${prop.propName}" value="<@jspEl 'conditionMap.${prop.propName}'/>" class="inputStyle" type="text" />
	    </td>
	</#if>
	<#if (porpNo!=1 && porpNo % 3 ==0)></tr></#if>
	</#if>
	<#if (porpNo%3 !=0 && !prop_has_next)></tr></#if> 
	</#list>
	</table>
	</form>
	</div>
</div>

<!-- 表格 -->
<div class="wrapper" id="tableDivId">
<div class="title"> 查询列表 </div>
<table class="grid">
<tbody>
	<tr>
		<th width="30px"></th>
		<#list tableClazz.getTableCols() as prop>
   		<#if prop.propName != "versionNo" && prop.propName != "class" && prop.propName != "updateUser" && prop.propName != "updateTime">
   			<th>${prop.propCnName}</th>
   		</#if>        
		</#list>
		<th width="60px">操作</th>
	</tr>
	<s:iterator value="%{pageData.datals}" id='vo' status='st'>
	<tr <s:if test="#st.even">class="spritTr"</s:if>>
		<td align="center"><s:property value="#st.count+(pageData.currentPage-1) * (pageData.pageSize)" /></td>
		<#assign porpNo = 0>
		<#list tableClazz.getTableCols() as prop> 
    	<#if prop.propName != "versionNo" && prop.propName != "class" && prop.propName != "updateUser" && prop.propName != "updateTime">
   		
   		<td <#if prop.javaType == 'Long'||prop.javaType=='BigDecimal'>style="text-align:right"</#if>>
   		<#assign porpNo=porpNo+1><#if (porpNo==1)><a href="#" target="_self" onclick="return doAction('view','<@jspEl 'vo.${tableClazz.pkProp.propName}'/>');" ></#if>
    	<#if prop.javaType == 'Date'>	
		<fmt:formatDate value="<@jspEl 'vo.${prop.propName}'/>" pattern ="yyyy-MM-dd"/>
		<#elseif prop.javaType =='Long'>
		<@jspEl 'vo.${prop.propName}'/>
		<#elseif prop.javaType =='BigDecimal'>
		<fmt:formatNumber pattern="0.0000"><@jspEl 'vo.${prop.propName}'/></fmt:formatNumber>
		<#else>
		<@jspEl 'vo.${prop.propName}'/></#if><#if (porpNo==1)></a></#if></td>
		</#if>
		</#list> 
    	<td>
    	<a href="#" target="_self" onclick="return doAction('view','<@jspEl 'vo.${tableClazz.pkProp.propName}'/>');" >查看</a> 	
    	</td>
    </tr>			
</s:iterator>       
</tbody>
<tfoot></tfoot>	
</table>
<s:if test="pageData.totalPageNum > 1"><s:include value="/common/pager.jsp"/></s:if>
</div>
<jsp:include page="/common/show_action_message.jsp"></jsp:include>
</body>
</html>